//
//  BaseEncode.m
//  App
//
//  Created by gome on 2018/12/12.
//  Copyright © 2018 gome. All rights reserved.
//

#import "BaseEncode.h"
#import "Base16.h"
#import "Base32.h"

@implementation BaseEncode
+ (NSString *)base64WithString:(NSString *)content {
    NSData *contentData = [content dataUsingEncoding:NSUTF8StringEncoding];
    NSString *base64 = [contentData base64EncodedStringWithOptions:NSDataBase64EncodingEndLineWithLineFeed];
    return base64;
}

+ (NSString *)base32WithString:(NSString *)content keys:(NSString *)keys{
    
    NSString *base32 = [Base32 enCodeBase32String:content keyList:keys];
    return base32;
}

+ (NSString *)stringWithBase32:(NSString *)content keys:(NSString *)keys {
    NSString *originString = [Base32 deCodeBase32String:content keyList:keys];
    return originString;
}

+ (NSString *)base16WithString:(NSString *)content keys:(NSString *)keys{
    NSString *base16 = [Base16 enCodeBase16String:content keyList:keys];
    return base16;
}

+ (NSString *)stringWithBase16:(NSString *)content keys:(NSString *)keys {
    NSString *originString = [Base16 deCodeBase16String:content keyList:keys];
    return originString;

}

@end
